{% extends 'airshow/base.html' %}

{% block title %}{{ area.name }} - 展区详情{% endblock %}

{% block content %}
<nav aria-label="breadcrumb">
    <ol class="breadcrumb">
        <li class="breadcrumb-item"><a href="{% url 'airshow:index' %}">首页</a></li>
        <li class="breadcrumb-item"><a href="{% url 'airshow:area_list' %}">展区列表</a></li>
        <li class="breadcrumb-item active" aria-current="page">{{ area.name }}</li>
    </ol>
</nav>

<div class="card mb-4">
    <div class="card-header">
        <h3>{{ area.name }}</h3>
    </div>
    <div class="card-body">
        <p><strong>位置：</strong> {{ area.location|default:"未设置" }}</p>
    </div>
</div>

<div class="card">
    <div class="card-header d-flex justify-content-between align-items-center">
        <h4>参展商列表</h4>
    </div>
    <div class="card-body">
        {% if exhibitors %}
            <div class="table-responsive">
                <table class="table table-striped">
                    <thead>
                        <tr>
                            <th>ID</th>
                            <th>名称</th>
                            <th>国家/地区</th>
                            <th>联系人</th>
                            <th>联系电话</th>
                            <th>展品数量</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        {% for exhibitor in exhibitors %}
                            <tr>
                                <td>{{ exhibitor.exhibitor_id }}</td>
                                <td>{{ exhibitor.name }}</td>
                                <td>{{ exhibitor.country|default:"未知" }}</td>
                                <td>{{ exhibitor.contact_person|default:"未设置" }}</td>
                                <td>{{ exhibitor.contact_phone|default:"未设置" }}</td>
                                <td>{{ exhibitor.num_exhibits }}</td>
                                <td>
                                    <a href="{% url 'airshow:exhibitor_detail' exhibitor.exhibitor_id %}" class="btn btn-sm btn-info">查看详情</a>
                                </td>
                            </tr>
                        {% endfor %}
                    </tbody>
                </table>
            </div>
        {% else %}
            <p class="text-center">该展区暂无参展商</p>
        {% endif %}
    </div>
</div>
{% endblock %} 